package com.augurit.common.base.form;

import java.util.List;

import com.augurit.common.sysfile.service.ISysFileService;
import com.augurit.common.sysfile.web.form.SysFileForm;
import com.augurit.common.syslog.service.ISysPropAuditLogService;
import com.augurit.common.syslog.web.form.SysPropAuditLogForm;

public abstract class AttachmentAndPropAuditLogForm extends BaseForm {
	
	/**
	 * 按照修改人和修改时间顺序加载字段审计日志信息
	 * @param form
	 * @param entity
	 * @param entityId
	 * @param sysPropAuditLogService
	 */
	public void loadOrderByUpdatorAndTime(String entity, String entityId, ISysPropAuditLogService sysPropAuditLogService){
		List<SysPropAuditLogForm> list = sysPropAuditLogService.getLogListOrderByUpdatorAndTime(entity, entityId);
		this.setPropAuditLogList(list);
	}
	
	/**
	 * 按照修改属性和修改时间顺序加载字段审计日志信息
	 * @param form
	 * @param entity
	 * @param entityId
	 * @param sysPropAuditLogService
	 */
	public void loadOrderByPropertyAndTime(String entity, String entityId, ISysPropAuditLogService sysPropAuditLogService){
		List<SysPropAuditLogForm> list = sysPropAuditLogService.getLogListOrderByPropertyCommentAndTime(entity, entityId);
		this.setPropAuditLogList(list);
	}
	
	/**
	 * 加载附件列表
	 * @param form
	 * @param entity
	 * @param entityId
	 * @param sysFileService
	 */
	public void loadAttachmentList(String entity, String entityId, ISysFileService sysFileService){
		List<SysFileForm> list = sysFileService.getByEntityAndEntityId(entity, Long.valueOf(entityId));
		this.setAttachmentList(list);
	}
	
	//属性
	private List<SysPropAuditLogForm> propAuditLogList;	//字段审计日志列表
	private List<SysFileForm> attachmentList;	//附件列表

	
	public List<SysPropAuditLogForm> getPropAuditLogList() {
		return propAuditLogList;
	}

	public void setPropAuditLogList(List<SysPropAuditLogForm> propAuditLogList) {
		this.propAuditLogList = propAuditLogList;
	}

	public List<SysFileForm> getAttachmentList() {
		return attachmentList;
	}

	public void setAttachmentList(List<SysFileForm> attachmentList) {
		this.attachmentList = attachmentList;
	}
}
